package com.lvmama.pangolin.tc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lvmama.pangolin.entity.ProductConditionVO;
import com.lvmama.pangolin.entity.tc.TCTicketProduct;
import com.lvmama.pangolin.entity.xc.XCTicketProduct;
import com.lvmama.pangolin.tc.service.TCTicketProductService;
import com.lvmama.pangolin.mybatis.mapper.tc.TCTicketProductMapper;

@Transactional
@Service
public class TCTicketProductServiceImpl implements TCTicketProductService
{
	@Autowired
	private TCTicketProductMapper ticketProductMapper;
	@Override
	public int deleteByPrimaryKey(String id)
	{
		return ticketProductMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int deleteByByProdId(String product_id)
	{
		return ticketProductMapper.deleteByByProdId(product_id);
	}

	@Override
	public int insert(TCTicketProduct record)
	{
		return ticketProductMapper.insert(record);
	}

	@Override
	public int insertSelective(TCTicketProduct record)
	{
		return ticketProductMapper.insertSelective(record);
	}

	@Override
	public TCTicketProduct selectByPrimaryKey(String id)
	{
		return ticketProductMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<TCTicketProduct> selectAll() {
		return ticketProductMapper.selectAll();
	}

	@Override
	public TCTicketProduct selectByProdId(String productId)
	{
		return ticketProductMapper.selectByProdId(productId);
	}

	@Override
	public int updateByPrimaryKeySelective(TCTicketProduct record)
	{
		return ticketProductMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByProdIdSelective(TCTicketProduct record)
	{
		return ticketProductMapper.updateByProdIdSelective(record);
	}

	@Override
	public int updateByPrimaryKey(TCTicketProduct record)
	{
		return ticketProductMapper.updateByPrimaryKey(record);
	}

	@Override
	public PageInfo<TCTicketProduct> getAllList(ProductConditionVO pc) {
		PageHelper.startPage(pc.getPage(), pc.getPageSize());
		List<TCTicketProduct> list = ticketProductMapper.getAllList(pc);
        PageInfo<TCTicketProduct> page = new PageInfo<TCTicketProduct>(list);
		return page;
	}


	@Override
	public List<TCTicketProduct> selectByName(String name) {
		
		return ticketProductMapper.selectByName(name);
	}

	@Override
	public void updateByProdId(String productId) {
		ticketProductMapper.updateByProdId(productId);
		
	}

	@Override
	public void deleteLinkByProdId(String productId) {
		ticketProductMapper.deleteLinkByProdId(productId);
		
	}

	@Override
	public List<TCTicketProduct> selectByUrl(String url) {
		return ticketProductMapper.selectByUrl(url);
	}
	
}
